5 #include "ScreenIncludes.h"
8 namespace OpeningSequence
10 void OpeningSequence(int* screen
, SDL_Renderer
* r1
, SDL_Window
* win
);
20 bool endTransitionFlag
;
31 DATATYPE_MILLISECONDS systemTime
;
38 long long initial
= 0;
39 long long expired
= 0;
56 std::vector
<bool>* inputs
;
58 void OpeningSequence::OpeningSequence(int* screen
, SDL_Renderer
* rend
, SDL_Window
* win
)
60 OpeningSequence::screen
= screen
;
68 engSymbol
= new Texture(SDL_Rect
{0,0,Graphics::prcnt(0.1, 'x', w1
),Graphics::prcnt(0.1, 'y', w1
) }, "Icons/EN.png", r1
, w1
);
69 jpSymbol
= new Texture(SDL_Rect
{ 500,500,Graphics::prcnt(0.1, 'x', w1
),Graphics::prcnt(0.1, 'y', w1
) }, "Icons/JP.png", r1
, w1
);
74 void OpeningSequence::gameLoop() {
76 systemTime
= SYSTEM_MILLISECONDS
;
80 while (screenRunning
) {
81 systemTime
= SYSTEM_MILLISECONDS
;
82 initial
= systemTime
.count();
89 GenericGameTools::stallGame(&initial
, &expired
, (int)(1.0 / FPS
* 1000));
95 void OpeningSequence::processInput() {
97 inputs
= mio
->processMouseInput(&x
, &y
);
99 screenRunning
= !inputs
->at(QUIT
);
103 void OpeningSequence::update() {
105 systemTime
= SYSTEM_MILLISECONDS
;
106 timer
= systemTime
.count();
107 int elapsed
= timer
- start
;
109 else if (timer
< 123 && timer
> -1 ) {
114 else if (timer
< 456 && timer
> -1) {
119 else if (timer
< 789 && timer
> -1) {
120 endTransitionFlag
= true;
122 //if transition reaches a point end the opening screen
125 else if (timer
< 1123 && timer
> -1) {
126 screenRunning
= false;
128 else if(langClicked
){
129 //load respective text
135 //set end transition flags
136 //set timer to a certain pointer
141 void OpeningSequence::play() {
144 void OpeningSequence::render() {
148 //if alpha is not at max
152 //if alpha is not at max
156 //if alpha is not at max
160 //if alpha is not at max
162 engSymbol
->renderTexture();
163 jpSymbol
->renderTexture();
165 SDL_RenderPresent(r1
);
167 void OpeningSequence::close() {